package com.zzh.demo.provider1.framework.listener;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

/**
 * description： <br>
 * createTime: 2018/1/516:17 <br>
 *
 * @author zzh
 */
@WebListener
@Component
@Slf4j
public class SessionListener implements HttpSessionListener {

    @Override
    public void sessionCreated(HttpSessionEvent httpSessionEvent) {
        log.info("aaaa--created session : " + httpSessionEvent.getSession().getId());
    }


    @Override
    public void sessionDestroyed(HttpSessionEvent httpSessionEvent) {
        log.info("aaaa--destroy session : " +  httpSessionEvent.getSession().getId());
    }
}
